package cn.gov.pbc.gd.credit.vo.center.charge;

import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.Map;

import com.liu.tools.StrUtil;

/**
 * @author liuxingmi
 * @datetime 2017年6月6日 上午10:26:15
 * @desc 缴费及撤销缴费请求参数
 */
public class ReqCCChargeVo {
	
	//缴费请求：{user:user,ctype:ctype,idno:idno,querytype:querytype,reltel:reltel,relname:relname,relcerttype:relcerttype,
	//relcertno:relcertno,forwardtype:"1"}
 
	//撤销缴费请求：{chargeNO:chargeNO,updatetype:"2",forwardtype:"2"}
	
	/**
	 * 查询id
	 */
	private String id;
	
	/**
	 * 请求类型：1-缴费，2-撤销缴费
	 */
	private String forwardtype;


	/**
	 * 查询类型(24-个人明细版，21-个人简单版)
	 */
	private Integer querytype;
	
	/**
	 * 用户姓名
	 */
	public String user;
	
	/**
	 * 证件类型
	 */
	private String ctype;
	
	/**
	 * 证件号码
	 */
	private String idno;
	
	/**
	 * 代理人联系方式
	 */
	private String reltel;
	
	/**
	 * 代理人姓名
	 */
	private String relname;
	
	/**
	 * 代理人证件类型
	 */
	private String relcerttype;
	
	/**
	 * 代理人证件号码
	 */
	private String relcertno;
	
	/**
	 * 缴费编号
	 */
	private String chargeNo;
	
	/**
	 * 费用金额
	 */
	private double feeAmount;

	public double getFeeAmount() {
		return feeAmount;
	}

	public void setFeeAmount(double feeAmount) {
		this.feeAmount = feeAmount;
	}

	private Map<String, String> cookies;

	public String getForwardtype() {
		return forwardtype;
	}

	public void setForwardtype(String forwardtype) {
		this.forwardtype = forwardtype;
	}

	public Integer getQuerytype() {
		return querytype;
	}

	public void setQuerytype(Integer querytype) {
		this.querytype = querytype;
	}

	public String getUser() {
		return user;
	}

	public void setUser(String user) {
		this.user = user;
	}

	public String getCtype() {
		return ctype;
	}

	public void setCtype(String ctype) {
		this.ctype = ctype;
	}

	public String getIdno() {
		return idno;
	}

	public void setIdno(String idno) {
		this.idno = idno;
	}

	public String getReltel() {
		return reltel;
	}

	public void setReltel(String reltel) {
		this.reltel = reltel;
	}

	public String getRelname() {
		return relname;
	}

	public void setRelname(String relname) {
		this.relname = relname;
	}

	public String getRelcerttype() {
		return relcerttype;
	}

	public void setRelcerttype(String relcerttype) {
		this.relcerttype = relcerttype;
	}

	public String getRelcertno() {
		return relcertno;
	}

	public void setRelcertno(String relcertno) {
		this.relcertno = relcertno;
	}

	public Map<String, String> getCookies() {
		return cookies;
	}

	public void setCookies(Map<String, String> cookies) {
		this.cookies = cookies;
	}

	public String getChargeNo() {
		return chargeNo;
	}

	public void setChargeNo(String chargeNo) {
		this.chargeNo = chargeNo;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	/**
	 * @author liuxingmi
	 * @datetime 2017年6月6日 上午11:44:09
	 * @desc 撤销缴费请求数据
	 * @return String
	 */
	public String toCancelChargeStr() {
		return "chargeNO="+ chargeNo +"&updatetype=2&forwardtype=2";
	}
	
	@Override
	public String toString() {
		
		try {
			if(StrUtil.isNotNull(user)){
				user = URLEncoder.encode(user,"UTF-8");
			}
			if(StrUtil.isNotNull(relname)){
				relname = URLEncoder.encode(relname,"UTF-8");
			}
		} catch (UnsupportedEncodingException e) {
			
		}
		
		return ("forwardtype=" + 1 + "&querytype=" + querytype
				+ "&user=" + user + "&ctype=" + ctype + "&idno=" + idno + "&reltel=" + reltel + "&relname="
				+ relname + "&relcerttype=" + relcerttype + "&relcertno=" + relcertno).replaceAll("null", "");
	}
	
}
